#!/usr/bin/env python3

import common
import json
import path_properties

class Main(common.LkmcCliFunction):
    def __init__(self):
        super().__init__(
            defaults = {
                'show_time': False,
            },
            description='''\
Get the path_properties for an userland executable:
https://cirosantilli.com/linux-kernel-module-cheat#path-properties
TODO check that the path exists.
''',
        )
        self.add_argument('path')

    def timed_main(self):
        properties = path_properties.get(self.env['path']).properties
        for key in sorted(properties):
            print('{}={}'.format(key, properties[key]))

if __name__ == '__main__':
    Main().cli()
